Skip to content

Add seven security audit scripts and a complete linked README catalog - #7

Merged
SecopsEngineer merged 2 commits into
mainfrom
feature/security-audit-reports
Oct 27, 2026
Merged

SecopsEngineer merged 2 commits into
mainfrom
feature/security-audit-reports

Conversation

@SecopsEngineer

Copy link
Copy Markdown
Owner

The collection lacked privileged-access, inactivity, credential-expiry, forwarding, exposure, persistence and snapshot-comparison reports. Add seven reporting-only scripts and document every runnable entry point so users can find a task, check its prerequisites and understand the limits before running it.

New reports

  • Get-ADPrivilegedGroupMembers.ps1: direct/nested membership paths with friendly and distinguished names, cached group reads, cycle detection and explicit depth-limit/foreign-principal status.
  • Get-ADStaleAccounts.ps1: configurable user/computer inactivity candidates, optional OU/credentials/disabled-account scope, approximate-logon and creation-fallback evidence.
  • Get-EntraAppCredentialExpiry.ps1: tenant-checked application secret/certificate expiry metadata. Explicit output projection excludes secret text, hints and certificate bytes.
  • Get-O365MailboxForwarding.ps1: mailbox forwarding and hidden/disabled inbox forwarding rules, accepted-domain classification, mail-contact routing resolution and unknown group/unresolved-recipient flags.
  • Get-AzurePublicExposure.ps1: public IP inventory and broad inbound NSG management-port candidates, supporting IPv6, plural fields and ranges. Restores caller Azure context.
  • Get-WindowsPersistence.ps1: local/remote service, task-action, machine/loaded-user Run/RunOnce and Startup-file snapshots without executing targets.
  • Compare-SecurityReports.ps1: CSV additions/removals/property changes with explicit composite keys, duplicate/blank-key rejection, schema validation and input overwrite protection.

Documentation

README now links all 35 runnable scripts, lists prerequisites/access and change behavior, and includes supporting scripts. docs/SecurityAudits.md provides examples, output interpretation, coverage limits and Microsoft references for all seven additions. Tests enforce catalog links/count so future additions cannot silently outgrow it.

Validation

  • Windows PowerShell 5.1 and PowerShell 7: complete 67-test suite passed, including all 35 existing regressions and 32 new audit/catalog regressions.
  • Parsing, PSScriptAnalyzer warning/error checks and whitespace checks passed.
  • Final distinguished-name path addition revalidated with the 32 audit/catalog tests and analyzer.
  • Tests use fail-closed mocks and synthetic data. No production directories, tenants, mailbox configurations or endpoint settings were accessed or changed.

Limits

These reports are investigation inputs, not automatic remediation or proof of effective access. AD logon dates are approximate; primary-group/ACL privilege paths are outside scope. Azure rules are potential exposure and do not model deny precedence or network reachability. Forwarding delivery policies/chains and group expansion are not evaluated. Application reports cover registrations rather than service principals. Persistence coverage excludes unloaded hives and WMI subscriptions. Controlled non-production integration checks are still needed for live service roles and environmental behavior.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T23:09:18.050761Z — PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Get-WindowsPersistence.ps1 Resolved
@SecopsEngineer
SecopsEngineer merged commit fd33296 into main Oct 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant